package pers.crayon.baseprogram.model;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * Result的简单替换
 *
 * @author roamay.com
 * @since 2021/2/22 18:11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel("出参公共返回对象")
public class Result<T> {

    @ApiModelProperty("状态码")
    private String code;
    @ApiModelProperty("信息")
    private String msg;
    @ApiModelProperty("返回对象")
    private T data;

    public Result(String errorCode, String message) {
        this.code = errorCode;
        this.msg = message;
    }
}
